Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Displaying Raw • Download


scripts/test_wheel.sh 83f480be3cbef25aff58b72fd90e1a8357a6d885 (83f480be) Text, 2.21 KB

T8b949e#!/bin/bash
Tffa657set -e

T8b949e# Find wheel file dynamically
Te6edf3WHEEL_PATTERNTff7b72=Ta5d6ff"python-dist/reticulum_meshchatx-*-py3-none-any.whl"
Te6edf3WHEEL_FILESTff7b72=Tff7b72(Te6edf3$WHEEL_PATTERNTff7b72)

Tff7b72if Tff7b72[ Tffd700${#Te6edf3WHEEL_FILESTb4b4b4[@]Tffd700} -eq T79c0ff0 Tff7b72]Tb4b4b4; Tff7b72then
Tffa657echo Ta5d6ff"Ta5d6ffError: No wheel files found matching pattern: Te6edf3$WHEEL_PATTERNTa5d6ff"
Tffa657echo Ta5d6ff"Make sure to run 'poetry build' or similar to create the wheel first."
Tffa657exit T79c0ff1
Tff7b72elif Tff7b72[ Tffd700${#Te6edf3WHEEL_FILESTb4b4b4[@]Tffd700} -gt T79c0ff1 Tff7b72]Tb4b4b4; Tff7b72then
Tffa657echo Ta5d6ff"Error: Multiple wheel files found:"
Tffa657printf Ta5d6ff' %s\n' Ta5d6ff"Tffd700${Te6edf3WHEEL_FILESTb4b4b4[@]Tffd700}Ta5d6ff"
Tffa657echo Ta5d6ff"Please clean up old wheels or specify which one to use."
Tffa657exit T79c0ff1
Tff7b72fi

Te6edf3WHEEL_PATHTff7b72=Ta5d6ff"Tffd700${Te6edf3WHEEL_FILESTb4b4b4[0]Tffd700}Ta5d6ff"

Tff7b72if Tff7b72[ ! -f Ta5d6ff"Te6edf3$WHEEL_PATHTa5d6ff" Tff7b72]Tb4b4b4; Tff7b72then
Tffa657echo Ta5d6ff"Ta5d6ffError: Wheel not found at Te6edf3$WHEEL_PATHTa5d6ff"
Tffa657exit T79c0ff1
Tff7b72fi

Tffa657echo Ta5d6ff"Ta5d6ffFound wheel: Te6edf3$WHEEL_PATHTa5d6ff"

Tffa657echo Ta5d6ff"Creating test virtual environment..."
Te6edf3TEST_VENVTff7b72=Tff7b72$(mktemp -dTff7b72)/test-venv
python3 -m venv Ta5d6ff"Te6edf3$TEST_VENVTa5d6ff"

Tffa657echo Ta5d6ff"Installing wheel..."
Ta5d6ff"Te6edf3$TEST_VENVTa5d6ff/bin/pipTa5d6ff" install --upgrade pip
Ta5d6ff"Te6edf3$TEST_VENVTa5d6ff/bin/pipTa5d6ff" install Ta5d6ff"Te6edf3$WHEEL_PATHTa5d6ff"

Tffa657echo Ta5d6ff""
Tffa657echo Ta5d6ff"Checking installation..."
Ta5d6ff"Te6edf3$TEST_VENVTa5d6ff/bin/pythonTa5d6ff" Ta5d6ff<< 'PYTHON_SCRIPT'
import meshchatx.meshchat as meshchat
import os
from pathlib import Path

print(f'meshchat module location: {meshchat.__file__}')

meshchat_dir = os.path.dirname(meshchat.__file__)
public_path = os.path.join(meshchat_dir, 'public')
print(f'Checking for public at: {public_path}')
print(f'Exists: {os.path.exists(public_path)}')

from meshchatx.meshchat import get_file_path
test_path = get_file_path('public')
print(f'get_file_path("public"): {test_path}')
print(f'Exists: {os.path.exists(test_path)}')

if os.path.exists(test_path):
index_html = os.path.join(test_path, 'index.html')
print(f'index.html exists: {os.path.exists(index_html)}')
else:
print('WARNING: public directory not found!')
print('Checking parent directories...')
current = meshchat_dir
for i in range(3):
test = os.path.join(current, 'public')
print(f' {test}: {os.path.exists(test)}')
current = os.path.dirname(current)
PYTHON_SCRIPT

Tffa657echo Ta5d6ff""
Tffa657echo Ta5d6ff"Ta5d6ffTest complete. Virtual environment at: Te6edf3$TEST_VENVTa5d6ff"
Tffa657echo Ta5d6ff"Ta5d6ffTo test running meshchat: Te6edf3$TEST_VENVTa5d6ff/bin/meshchat --helpTa5d6ff"


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────